<style scoped>
    .main {
        height: 100%;
    }

    .main /deep/ .hd-header .header-text-default {
        left: 260px;
    }
</style>

<template>
    <div class="main">
        <main-theme2
                ref="mainTheme"
                :siderWidth="200"
                homeName="首页"
                logoPath="https://oss.shengshitong.com/yqdata/house/Wl/header.png"
                collapsible
                :nav-tag-show="true"
                :notice-show="true"
                :helpPath="helpPath"
                :headerTextStyle="headerTextStyle"
                :headerMenusShow="closeHeaderMenu">
            <keep-alive include="sysStaffManager">
                <router-view></router-view>
            </keep-alive>
        </main-theme2>
        <wl-customer></wl-customer>
    </div>
</template>

<script>
import { mapActions } from 'vuex'
import WlCustomer from '@/views/pages/home/components/customer/index'

export default {
  components: { WlCustomer },
  data () {
    return {
      closeHeaderMenu: true,
      headerTextStyle: { text: '档案接收管理平台', lineWidth: '400px' },
      severUserInfo: {}
    }
  },
  methods: {
    ...mapActions([
      'getUserInfo',
      'setUserInfo',
      'getPhpMenusData',
      'getJavaMenusData',
      'setBreadCrumb'
    ]),
    logout () {
      this.$refs.mainTheme.logout()
    }
  },
  computed: {
    companyType () {
      return window.localStorage.getItem('company_type')
    },
    helpPath () {
      // console.log(this.companyType, window.localStorage.getItem('company_type'), '企业类型')
      if (this.companyType && this.companyType === '1') {
        return 'https://note.youdao.com/ynoteshare/index.html?id=f219ae9367744376a758bdad1eeaf17b&type=note&_time=1682230593979'
      } else {
        return 'https://note.youdao.com/ynoteshare/index.html?id=976fa20cea62dd86d47ee89723973d89&type=note&_time=1682230563807'
      }
    },
    getUserName () {
      let userInfo = this.$store.state.user.severUserInfo.data
      if (!this.$common.xeUtils.isEmpty(userInfo)) {
        return userInfo.company_name + '【' + userInfo.loginName + '】'
      } else {
        return '未登录'
      }
    }
  },
  mounted () {
    // TODO 如果是java菜单还需要调用综合菜单-id需要自己配置
    this.getUserInfo().then(resx => {
    })
    this.severUserInfo = this.$store.state.user.severUserInfo
    this.getJavaMenusData('0,1,bf0764d1-3373-11ea-ba01-ec0d9acf02d2')
  }
}
</script>
